package com.spx.core.ui.views;

import java.util.HashMap;
import java.util.Map;

import org.eclipse.swt.graphics.Image;

import com.spx.kernel.types.ModelType;

public class ModelImageRegistry
{
	Map<Class<? extends ModelType>, Image> map = new HashMap<Class<? extends ModelType>, Image>();

	private static ModelImageRegistry instance;

	private ModelImageRegistry()
	{

	}

	public synchronized static ModelImageRegistry getInstance()
	{
		if (instance == null)
		{
			instance = new ModelImageRegistry();
		}
		return instance;
	}

	public void register(Class<? extends ModelType> type, Image image)
	{
		map.put(type, image);
	}

	public Image fetch(Class<? extends ModelType> type)
	{
		return map.get(type);
	}

}
